package gamebackend;

import java.util.Random;

import framework.Point;

public class EasyFlier extends AbstractFlier {
	private static final int TIME_DELTA = (int) (1000.0 / 30);
	private int my_delayBeforeNextMove;
	final Random my_random;
	private final int my_minX;
	private final int my_maxX;

	public EasyFlier(final Flier the_child, final Random the_random, final int the_minX, final int the_maxX) {
		super(the_child);
		my_random = the_random;
		my_minX = the_minX;
		my_maxX = the_maxX;
	}
	@Override
	public void step(final double the_yChange) {
		super.step(the_yChange);
	
		if (my_delayBeforeNextMove <= 0) {
			getChild().setTarget(my_random.nextDouble() * (my_maxX - my_minX) + my_minX);
			my_delayBeforeNextMove = (int) (my_random.nextDouble() * 1000 + 250);
		}
		my_delayBeforeNextMove -= TIME_DELTA;
	}
	

}
